﻿var Metadata = Metadata || {};
MetaData.Tables = {}; 

// 0x20
MetaData.Tables.AssemblyTable = function () {
    this.HashAlgId = "";  // 4bc - AssemblyHashAlgorithm
    this.MajorVersion = 0; // 2bc
    this.MinorVersion = 0;
    this.BuidlNumber = 0;
    this.Revision = 0;
    this.Flags = 0; // 4 byte bitmask - AssemblyFlags;
    this.PublicKey = 0; // Blob(idx)
    this.Name = 0; // String(idx)
    this.Culture = 0; // String(idx)
};

// 0x22
MetaData.Tables.AssemblyOS = function () {
    this.OSPlatformID = 0; // 4bc
    this.OSMajorVersion = 0; // 4bc
    this.OSMinorVersion = 0; // 4bc
};

// 0x21
MetaData.Tables.AssemblyProcessor = function () {
    this.Processor = 0; // 4bc
};

// 0x23
MetaData.Tables.AssemblyRef = function () {
    this.MajorVersion = 0; // 2bc
    this.MinorVersion = 0;
    this.BuidlNumber = 0;
    this.Revision = 0;
    this.Flags = 0; // 4 byte bitmask - AssemblyFlags;
    this.PublicKeyOrToken = 0; // Blob(idx)
    this.Name = 0; // String(idx)
    this.Culture = 0; // String(idx)
    this.HashValue = 0; // Blob(idx)
};

// 0x25
MetaData.Tables.AssemblyRefOS = function () {
    this.OSPlatformID = 0; // 4bc
    this.OSMajorVersion = 0; // 4bc
    this.OSMinorVersion = 0; // 4bc
    this.AssemblyRef = 0; // AssemblyRef(idx)
};

// 0x24
MetaData.Tables.AssemblyRefProcessor = function () {
    this.Processor = 0; // 4bc
    this.AssemblyRef = 0; // AssemblyRef(idx)
};

// 0x0F
MetaData.Tables.ClassLayout = function () {
    this.PackingSize = 0; // 2bc
    this.ClassSize = 0; // 4bc
    this.Parent = 0; // TypeDef(idx)
};

// 0x0B
MetaData.Tables.Constant = function () {
    this.Type = 0; // 1bc
    this.Parent = 0; // Param/Field/Property(idx)
    this.Value = 0; // Blob(idx)
};

// 0x0C
MetaData.Tables.CustomAttribute = function () {
    this.Parent = 0; // Any(idx) - HasCustomAttribute coded index
    this.Type = 0; // MethodDef/MemberRef(idx) - CustomAttributeType coded index
    this.Value = 0; // Blob(idx);
};

// 0x0E
MetaData.Tables.DclSecurity = function () {
    this.Action = 0; // 2bc
    this.Parent = 0; // TypeDef/MethodDef/Assembly(idx) - HasDeclSecurity coded index
    this.PermissionSet = 0; // Blob(idx)
};

// 0x12
MetaData.Tables.EventMap = function () {
    this.Parent = 0; // TypeDef(idx)
    this.EventList = 0; // Event(idx)
};

// 0x14
MetaData.Tables.Event = function () {
    this.EventFlags = 0; // 2bb - EventAttributes
    this.Name = 0; // String(idx)
    this.EventType = 0; // TypeDef/TypeRef/TypeSpec(idx) - TypeDefOrRef coded index
};

// 0x27
MetaData.Tables.ExportedType = function () {
    this.Flags = 0; // 4bb - TypeAttributes
    this.TypeDefId = 0; // TypeDef(idx)
    this.TypeName = 0; // String(idx)
    this.TypeNamespace = 0; // String(idx)
    this.Implementation = 0; // File/ExportedType(idx) - Implementation coded index
};

// 0x04
MetaData.Tables.Field = function () {
    this.Flags = 0; // 2bb FieldAttributes
    this.Name = 0; // String(idx)
    this.Signature = 0; // Blob(idx)
};

// 0x10
MetaData.Tables.FieldLayout = function () {
    this.Offset = 0; // 4bc
    this.Field = 0; // Field(idx)
};

// 0x0D
MetaData.Tables.FieldMarshal = function () {
    this.Parent = 0; // Field/Param(idx) - HasFieldMarshal coded index
    this.NativeType = 0; // Blob(idx)
};

// 0x1D
MetaData.Tables.FieldRVA = function () {
    this.RVA = 0; // 4bc
    this.Field = 0; // Field(idx)
};

// 0x26
MetaData.Tables.File = function () {
    this.Flags = 0; // 4bb - FileAttributes
    this.Name = 0; // String(idx)
    this.HashValue = 0; // Blob(idx)
};

// 0x2A
MetaData.Tables.GenericParam = function () {
    this.Number = 0; // 2b zero-based index
    this.Flags = 0; // 2bb - GenericParamAttributes
    this.Owner = 0; // TypeDef/MethodDef(idx) - TypeOrMethodDef coded index
};

// 0x2C
GenericParamConstraint = function () {
    this.Owner = 0; // GenericParam(idx)
    this.Constraint = 0; // TypeDef/TypeRef/TypeSpec(idx) - TypeDefOrRef coded index
};

// 0x1C
MetaData.Tables.ImplMap = function () {
    this.MappingFlags = 0; // 2bb - PInvokeAttributes
    this.MemberForwarded = 0; // Field/MethodDef(idx) - MemberForwarded coded index
    this.ImportName = 0; // String(idx)
    this.ImportScope = 0; // ModuleRef(idx)
};

// 0x09
MetaData.Tables.InterfaceImpl = function () {
    this.Class = 0; // TypeDef(idx)
    this.Interface = 0; // TypeDef/TypeRef/TypeSpec(idx) - TypeDefOrRef coded index
};

// 0x28
MetaData.Tables.ManifestResource = function () {
    this.Offset = 0; // 4bc
    this.Flags = 0; // 4bb - ManifestResourceAttributes
    this.Name = 0; // String(idx)
    this.Implementation = 0; // Implementation coded index
};

// 0x0A
MemberRef = function () {
    this.Class = 0; // MemberRefParent coded index
    this.Name = 0; // String(idx)
    this.Signature = 0; // Blob(idx)
};

// 0x06
MetaData.Tables.MethodDef = function () {
    this.RVA = 0; // 4bc
    this.ImplFlags = 0; // 2bb - MethodImplAttributes
    this.Flags = 0; // 2bb - MethodAttributes
    this.Name = 0; // String(idx)
    this.Signature = 0; // Blob(idx)
    this.ParamList = 0; // Param(idx)
};

// 0x19
MetaData.Tables.MethodImpl = function () {
    this.Class = 0; // TypeDef(idx)
    this.MethodBody = 0; // MethodDefOrRef coded index
    this.MethodDeclaration = 0; // MethodDefOrRef coded index
};

// 0x18
MetaData.Tables.MethodSemantics = function () {
    this.Semantics = 0; // 2bb - MethodSemanticsAttribute
    this.Method = 0; // Method(idx)
    this.Association = 0; // HasSemantics coded index
};

// 0x2B
MethodSpec = function () {
    this.Method = 0; // MethodDefOrRef coded index
    this.Instantiation = 0; // Blob(idx)
};

// 0x00
MetaData.Tables.Module = function () {
    this.Generation = 0; // 2bc, r 0
    this.Name = 0; // String(idx)
    this.Mvid = 0; // Guid(idx), r 0
    this.EnclId = 0; // Guid(idx), r 0
    this.EncBaseId = 0; // Guid(idx), r 0
};

// 0x1A
MetaData.Tables.ModuleRef = function () {
    this.Name = 0; // String(idx)
};

// 0x29
MetaData.Tables.NestedClass = function () {
    this.NestedClass = 0; // TypeDef(idx)
    this.EnclosingClass = 0; // TypeDef(idx)
};

// 0x08
MetaData.Tables.Param = function () {
    this.Flags = 0; // 2bb - ParamAttributes
    this.Sequence = 0; // 2bc
    this.Name = 0; // String(idx)
};

// 0x17
MetaData.Tables.Property = function () {
    this.Flags = 0; // 2bb - PropertyAttributes
    this.Name = 0; // String(idx)
    this.Type = 0; // Blob(idx)
};

// 0x15
MetaData.Tables.PropertyMap = function () {
    this.Parent = 0; // TypeDef(idx)
    this.PropertyList = 0; // Property(idx)
};

// 0x11
MetaData.Tables.StandAloneSig = function () {
    this.Signature = 0; // Blog(idx)
};

// 0x02
MetaData.Tables.TypeDef = function () {
    this.Flags = 0; // 4b bitmask of TypeAttributes
    this.TypeName = 0; // String(idx)
    this.TypeNamespace = 0; // String(idx)
    this.Extends = 0; // TypeDef/TypeRef/TypeSpec(idx) - TypeDefOrRef coded index
    this.FieldList = 0; // Field(idx)
    this.MethodList = 0; // MethodDef(idx);
};

// 0x01
MetaData.Tables.TypeRef = function () {
    this.ResolutionScope = 0; // Module/ModuleRef/AssemblyRef/TypeRef(idx) or null - ResolutionScope coded index
    this.TypeName = 0; // String(idx)
    this.TypeNamespace = 0; // String(idx)
};

// 0x1B
MetaData.Tables.TypeSpec = function () {
    this.Signature = 0; // Blob(idx)
};